﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FullThrustLogic.Helper;
using FullThrustLogic.ShipComponent.Weapon;

namespace FullThrustLogic.ShipComponent
{
    public class AttackOrder
    {



        public iWeapon TargetingWeapon
        {
            get;
            set;
        }

        public void ApplyOrder(Ship targetingShip, Ship targetedShip)
        {
            double distance = XYHelper.DistanceBetweenPoints(
                targetingShip.PositionX, 
                targetingShip.PositionY, 
                targetedShip.PositionX,
                targetedShip.PositionY);

            if (TargetingWeapon != null)
            {
                TargetingWeapon.ExcuteAttack(targetedShip, distance);
            }
        }
    }
}